//Removes input module from output module wherever both are non-zero
var input = argument0;
var output = argument1;
for(var iii = 0; iii < array_height_2d(input.tiles); iii++)
{
    for(var jjj = 0; jjj < array_length_2d(input.tiles, iii); jjj++)
    {
        if(input.tiles[iii, jjj] != 0 && output.tiles[input.tileY + iii, input.tileX + jjj] != 0)
        {
            var tile = 0;
            tile = output.tiles[input.tileY + iii, input.tileX + jjj];
            with(tile)
            {
                instance_destroy();
            }
            output.tiles[input.tileY + iii, input.tileX + jjj] = 0;
        }
    }
}